package com.example.zjm.fragmentdome;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

/**
 * 获取listview要显示数据集合
 */

public class DataSource {
    public static List<HashMap<String,Object>> getData(){
        List<HashMap<String,Object>> data = new ArrayList<>();
        HashMap<String,Object> hashMap = new HashMap<>();
        hashMap.put("img_id",R.drawable.guanyu);
        hashMap.put("name", "关羽");
        data.add(hashMap);

        hashMap = new HashMap<>();
        hashMap.put("img_id",R.drawable.zhangfei);
        hashMap.put("name", "张飞");
        data.add(hashMap);

        hashMap = new HashMap<>();
        hashMap.put("img_id",R.drawable.zhaoyun);
        hashMap.put("name", "赵云");
        data.add(hashMap);

        hashMap = new HashMap<>();
        hashMap.put("img_id",R.drawable.machao);
        hashMap.put("name", "马超");
        data.add(hashMap);

        hashMap = new HashMap<>();
        hashMap.put("img_id",R.drawable.huangzhong);
        hashMap.put("name", "黄忠");
        data.add(hashMap);

        return data;
    }
}
